package cn.bdqn.service.impl;

import cn.bdqn.domain.Nurse;
import cn.bdqn.mapper.NurseMapper;
import cn.bdqn.service.NurseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service("NurseService")
public class NurseServiceimpl implements NurseService {


    @Autowired
    private NurseMapper nurseMapper;

    /**
     * 根据id删除医生信息
     * @param id 需要删除的护士id
     * @return 是否成功
     */
    @Override
    public int takeOffNurseInformationByid(Integer id) {return nurseMapper.deleteByPrimaryKey(id); }

    /**
     *新增护士全部信息
     * @param record 需要添加的护士信息
     * @return 是否成功
     */
    @Override
    public int addNurseInformation(Nurse record) { return nurseMapper.insert(record); }

    /**
     * 新增护士部分信息
     * @param record 需要添加的护士信息
     * @return 是否成功
     */
    @Override
    public int addNurseInformationSelective(Nurse record) { return nurseMapper.insertSelective(record); }

    /**
     * 根据id查询护士信息
     * @param id 需要查询的护士id
     * @return 查询出来的护士信息
     */
    @Override
    public Nurse queryNurseInformationByid(Integer id) { return nurseMapper.selectByPrimaryKey(id); }

    /**
     * 修改护士全部信息
     * @param record 需要修改的护士信息
     * @return 是否成功
     */
    @Override
    public int changeNurseInformation(Nurse record) { return nurseMapper.updateByPrimaryKey(record); }

    /**
     * 修改护士部分信息
     * @param record 需要修改的护士信息
     * @return 是否成功
     */
    @Override
    public int changeNurseInformaitonBySelective(Nurse record) { return nurseMapper.updateByPrimaryKeySelective(record); }
}
